#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.oauth.configure;

import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;

/**
 * Description:
 *  身份存储
 *
 * @author wupanhua
 * @date 2019-09-02 22:38
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Configuration
@AllArgsConstructor
public class TokenStoreConfigure {

    private StringRedisTemplate stringRedisTemplate;

    /**
     * Description:
     * <配置jwt的存储方式>
     * @author ywh
     * @date 13:44 2019/8/7
     * @return org.springframework.security.oauth2.provider.token.TokenStore
     **/
    @Bean
    public TokenStore tokenStore() {
        return new RedisTokenStore(stringRedisTemplate.getConnectionFactory());
    }
}
